/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: HP
 * Date: 2023 -04 -29
 * Time: 23:33
 */


public class Rectangle extends GeoGraph{
    private int a;
    private int b;
    public Rectangle(){};
    public Rectangle(int a,int b) {
        this.a = a;
        this.b = b;
    }

    @Override
    public String toString() {
        return ("矩形的面积是：  "+getArea());
    }

    @Override
    public double getArea() {
        return a*b;
    };

    @Override
    public double getPerimeter() {
        return (a+b)*2;
    };

}

